﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Leikjavefurinn.Repo;

namespace Leikjavefurinn.Controllers
{
    public class ATAController : Controller
    {
		public ActionResult Index(Guid id)
		{
			ApplesRepo repo = new ApplesRepo();

			var this_game = repo.GetGameByID(id);

			//ef leikurinn er TIL þá er hann sendur inn í viewið. (!= null)*/               
			if (this_game != null)
			{
				return View(this_game);
			}

			return RedirectToAction("Error", "Shared"); 
		}

		public ActionResult About()
		{
			return View();
		}

        public ActionResult Create()
        {
            return View();
        }
    }
}
